package com.example.demo.repository;


import com.example.demo.domain.Category;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by 廖师兄
 * 2016-11-03 23:17
 */
public interface CateGoryRepository extends JpaRepository<Category, Integer> {

    @Query(value = "select * from category where name LIKE CONCAT('%',?3,'%') limit ?1,?2", nativeQuery = true)
    @Modifying
    public List<Category> findAllPage(int offset, int limit, String mess);

}
